/**
 * 
 */
package org.istt.service;

import java.util.List;

import org.istt.domain.Workflow;
import org.istt.web.helper.ExtendedPaginatedList;

/**
 * @author Huy
 *
 */
public interface WorkflowManager extends Manager<Workflow, Long> {
	
	/**
	 * Get all the WorkflowProcess by workflowId
	 * @param workflowId
	 * @return list of WorkflowProcess
	 */
	List<Object[]> getWfpByWfId(Long workflowId);
	
	/**
	 * Remove any Workflow process which is not involved to any file
	 */
	void removeWorkflowProcess(final Long workFlowId, final Long processStatusId);
	
	/**
	 * Return max position of a workflow process
	 * @param workFlowId
	 * @return
	 */
	Integer getMaxPosition(Long workFlowId);
	
	/**
	 * Whether this workflow can be deleted
	 * @param workflowId
	 * @return <code>true</code> if can be deleted otherwise <code>false</code>
	 */
	boolean isDeletable(Long workflowId);
	
	/**
	 * Get total day of work to complete the workflow
	 * @param workflowId
	 * @return total day of work
	 */
	Double getTotalDayOfWork(Long workflowId);
	
	ExtendedPaginatedList searchWf(String wfName, ExtendedPaginatedList paginatedList);
}
